﻿<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>动态窗口信息</title>
    <style type="text/css">
        body
        {
            font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
            color: #4f6b72;
            background: #E6EAE9;
        }

        #mytable
        {
            padding: 0;
            margin: 0;
        }

        th
        {
            font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
            color: #4f6b72;
            border-right: 1px solid #C1DAD7;
            border-bottom: 1px solid #C1DAD7;
            border-top: 1px solid #C1DAD7;
            letter-spacing: 2px;
            text-transform: uppercase;
            text-align: left;
            padding: 6px 6px 6px 12px;
            background: #CAE8EA no-repeat;
        }

        td
        {
            border-right: 1px solid #C1DAD7;
            border-bottom: 1px solid #C1DAD7;
            background: #fff;
            font-size: 11px;
            padding: 6px 6px 6px 12px;
            color: #4f6b72;
        }

        html > body td
        {
            font-size: 12px;
        }
    </style>
    <link rel="stylesheet" type="text/css" href="../Content/Css/OperaMasksUI/default/om-all.css" />
    <link rel="stylesheet" type="text/css" href="../Content/Css/list.css" />
    <script type="text/javascript" src="../Scripts/jquery.1.6.3.min.js"></script>
    <script type="text/javascript" src="../Scripts/json2.js"></script>
    <script type="text/javascript" src="../Scripts/common.js"></script>
    <script type="text/javascript" src="../Scripts/OperaMasksUI/operamasks-ui.min.js"></script>
    <script type="text/javascript" src="../Scripts/Plugin/jquery.form.js"></script>
    <script type="text/javascript" src="../Scripts/OperaMasksUI/Plugin/om-yj-container.js"></script>
    <script type="text/javascript" src="../Scripts/Plugin/artDialog4.1.7/jquery.artDialog.js?skin=default"></script>
    <script type="text/javascript" src="../Scripts/Plugin/artDialog4.1.7/plugins/iframeTools.js"></script>
    <script type="text/javascript" src="../Scripts/banBackSpace.js"></script>
    <script type="text/javascript">
        $(function () {
            var showV = art.dialog.data('showValue');
            var UID = art.dialog.data('showUID');
            var UserID = art.dialog.data('UserID');
            if (showV.length > 0) {
                var showTable = '<table id="mytable" style="width:100%;" cellspacing="0">';
                var tableHeader = '<tr><th align="center" width="30px" >序号</th>';
                var tableRow = '';
                $.each(showV, function (index, value) {
                    tableRow += '<tr><td align="center"> ' + (index + 1) + '</td>'
                    $.each(value, function (key, val) {
                        if (index == 0) {
                            tableHeader += '<th scope="col" style="width:20%;" >' + key + '</th>';
                        }
                        tableRow += '<td align="center" style="width:20%;">' + val + '</td>'
                    })
                    tableRow += '</tr>';
                });
                tableHeader += '</tr>';
                $("#showDiv").html(showTable + tableHeader + tableRow + "</table>");
                $('#button-collate').omButton({
                    icons: { left: '../Content/Images/List/accept.png' }, width: 80,
                    onClick: function () {
                        if (UID !== undefined) {
                            $.ajax({
                                cache: false, async: false,
                                url: '../handler/ajax.ashx?type=AjaxSystem&method=BillCollate',
                                dataType: 'json', type: 'post',
                                data: { UID: UID, USERID: UserID },
                                beforeSend: function () {
                                    $.omMessageBox.waiting({
                                        title: '请等待',
                                        content: '系统正在提交,请稍后...'
                                    });
                                },
                                complete: function () {
                                    $.omMessageBox.waiting("close");
                                },
                                success: function (data) {
                                    if (data.IsError) {
                                        $.omMessageBox.alert({
                                            content: '错误：' + data.Message
                                        });
                                    }
                                    else {
                                        $.omMessageBox.alert({
                                            content: "对账成功",
                                            onClose: function () {
                                                art.dialog.close();
                                            }
                                        });
                                    }
                                },
                                error: function (result) {
                                    $.omMessageBox.alert({
                                        content: '发现错误<BR>：' + result.status
                                    });
                                }
                            });
                        }
                    }
                });
            }
            else {
                $('#button-collate').hide();
            }
        })
    </script>
</head>
<body>
    <table style="width: 100%;">
        <tr>
            <td>
                <div id="showDiv" style="width: 100%;"></div>
            </td>
        </tr>
        <tr align="center">
            <td>
                <span id="button-collate">对  账</span>
            </td>
        </tr>
    </table>
</body>
</html>
